package com.ctsi.security.event.organ;


import com.ctsi.commons.event.AbstractObserver;
import com.ctsi.commons.event.BaseEvent;
import com.ctsi.framework.common.startrun.ComponentFactory;
import com.ctsi.organise.common.model.Organise;

/**
 * 组织结构删除组织
 * 
 * @author gbk
 * 
 */

public class DelOrganEvent extends AbstractObserver {
	private static org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(DelOrganEvent.class);
	private static OrganEventService organEventService;
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -7888088385977758221L;

	@Override
	public void onEvent(Object[] args) {
		logger.info("权限组织事件处理：组织结构删除组织");
		BaseEvent event=(BaseEvent) args[0];
		Organise organ=(Organise) event.getSource();
		organEventService=this.getOrganEventService();
		organEventService.delOrganEvent(organ.getPartyId());
	}
	
	private OrganEventService getOrganEventService(){
		if(organEventService==null){
			organEventService=(OrganEventService) ComponentFactory.getApplicationContext().getBean("organEventService");
		}
		return organEventService;
	}

}
